//
//  XTDairyTableViewCell.m
//  BeautifulHome
//
//  Created by dlios on 15-5-13.
//  Copyright (c) 2015年 ACE. All rights reserved.
//

#import "XTDairyTableViewCell.h"

@implementation XTDairyTableViewCell
- (void)dealloc
{
    [_nameLabel release];
    //[_styleLabel release];
    [_timeLabel release];
    [_titleLabel release];
    [_answerLabel release];
    [_myimageView release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.myimageView = [[[UIImageView alloc]init]autorelease];
        //_myimageView.image = [UIImage imageNamed:@"登陆.png"];
        //_myimageView.backgroundColor = [UIColor cyanColor];
        [self.contentView addSubview:_myimageView];
        
        self.nameLabel = [[[UILabel alloc]init]autorelease];
        //_nameLabel.text = @"平凡";
        //_nameLabel.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_nameLabel];
        
       // self.styleLabel = [[UILabel alloc]init];
        //_styleLabel.text = @"三室";
        //_styleLabel.backgroundColor = [UIColor cyanColor];
        //[self.contentView addSubview:_styleLabel];
        
        self.timeLabel = [[UILabel alloc]init];
        //_timeLabel.text = @"16小时前";
        //_timeLabel.backgroundColor = [UIColor blueColor];
        [self.contentView addSubview:_timeLabel];
        
        
        self.titleLabel = [[UILabel alloc]init];
        //_titleLabel.text = @"系诶装修日记";
        //_titleLabel.backgroundColor = [UIColor blueColor];
        [self.contentView addSubview:_titleLabel];
        
        self.answerLabel = [[UILabel alloc]init];
        //_answerLabel.text = @"浏览:15";
        //_answerLabel.backgroundColor = [UIColor blueColor];
        [self.contentView addSubview:_answerLabel];

        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    _myimageView.frame = CGRectMake(20, 10, 50, 50);
    _myimageView.layer.masksToBounds = YES;
    [_myimageView.layer setCornerRadius:25];
    
    _nameLabel.frame = CGRectMake(self.myimageView.frame.size.width + 40, 10, 130, 20);
    [_nameLabel setFont:[UIFont systemFontOfSize:15]];
    //_styleLabel.frame = CGRectMake(self.myimageView.frame.size.width + 30, 40, 200, 20);
    _timeLabel.frame = CGRectMake(self.myimageView.frame.size.width + 40, 30, 150, 30);
    _timeLabel.numberOfLines = 0;
    [_timeLabel setFont:[UIFont systemFontOfSize:15]];
    _titleLabel.frame = CGRectMake(15, self.myimageView.frame.size.height , self.contentView.frame.size.width - 25, 80);
    [_titleLabel setFont:[UIFont systemFontOfSize:17]];
    _titleLabel.numberOfLines = 0;
    _answerLabel.frame = CGRectMake(self.nameLabel.frame.size.width + 90, 10, 120, 20);
    [_answerLabel setFont:[UIFont systemFontOfSize:15]];
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
